package org.yunxin.id;

import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.RandomBasedGenerator;
import com.fasterxml.uuid.impl.TimeBasedEpochGenerator;

public class IdGenerator {

    private final static RandomBasedGenerator GENERATOR_V4 = Generators.randomBasedGenerator(); // Version 4

    private final static TimeBasedEpochGenerator GENERATOR_V7 = Generators.timeBasedEpochGenerator();

    public static String UUID_V4() {
        return GENERATOR_V4.generate().toString();
    }

    public static String UUID_V4_NONE() {
        return GENERATOR_V4.generate().toString().replace("-", "");
    }

    public static String UUID_V7() {
        return GENERATOR_V7.generate().toString();
    }

    public static String UUID_V7_NONE() {
        return GENERATOR_V7.generate().toString().replace("-", "");
    }

}

